<div class="settings index">
<h2><?php __('Settings');?></h2>

<div class="form">
<?php
    echo $form->create(
        'Setting', array(
            'action' => 'save'
        )
    );
?>
  <table id="form-table">
<?php foreach ($data as $i=>$field) { ?>
    <tr>
      <td class="label"><div style="margin-top:6px;"><?php __($field['Setting']['name']); ?>:</div></td>
      <td class="input"><?php
        echo $form->hidden('Setting.'.$i.'.id', array('value'=>$field['Setting']['id']));
        if ($field['Setting']['field_type'] == 'radio') {
            echo '<div class="input radio required">';
            echo $form->radio('Setting.'.$i.'.value', $field['Setting']['options'], $field['Setting']['attributes']);
            echo '</div>';
        } else {
            echo $form->input('Setting.'.$i.'.value', $field['Setting']['options']);
        }
      ?></td>
    </tr>
<?php } ?>
    <tr>
      <td></td>
      <td><?php echo $form->submit(__('Save',true), array('div'=>false)); ?></td>
    </tr>
  </table>
<?php
    echo $form->end();
?>
</div>

</div>
